package com.digitalchina.lxnsy.viewholder;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.PriceCountyDataVO;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：郑皓
 * 创建时间：2017/7/28 18:56
 * 修改备注：
 * ================================================
 */
public class CityTypePriceViewV2Holder extends BaseViewHolder<PriceCountyDataVO.CountyDataListBean> {

    private TextView tvName;
    private TextView tvSize;
    private TextView tvPrice;
    private View view;


    public CityTypePriceViewV2Holder(ViewGroup parent) {
        super(parent, R.layout.item_city_type_v2);
        tvName = $(R.id.item_tv_city_type);
        tvSize = $(R.id.item_tv_size);
        tvPrice = $(R.id.item_tv_city_price);
        view = $(R.id.item_city_view);
    }

    @Override
    public void setData(PriceCountyDataVO.CountyDataListBean data) {
        super.setData(data);
        tvName.setText(data.getTypeName());
        tvPrice.setText(data.getAveragePrice() + data.getPriceUnit());
        tvSize.setText(data.getComment() + "");
        if (getOwnerAdapter().getItemCount() == getAdapterPosition())
            view.setVisibility(View.INVISIBLE);
        else
            view.setVisibility(View.VISIBLE);
    }

}
